@import org.silkframework.workspace.ProjectTask
@import plugins.WorkbenchPlugins
@import plugins.WorkbenchPlugin.TaskActions
@import org.silkframework.util.Identifier
@import controllers.workflow.routes.Assets
@import org.silkframework.config.TaskSpec

@(project: org.silkframework.workspace.Project)

<div id="toolbox" style="height: 67.9px;">
  <div id="operatorToolbox">
    <div id="operatorToolboxHeader">
      Operators
    </div>
    @for(plugin <- WorkbenchPlugins();
         taskActions <- plugin.tasks if taskActions.name != "Dataset" && taskActions.name != "Workflow";
         task <- taskActions.projectTasks(project)) {
         @toolboxOperator(task, taskActions)
    }
  </div>
  <div id="datasetToolbox">
    <div id="datasetToolboxHeader">
      Datasets
    </div>
    @for(plugin <- WorkbenchPlugins();
        taskActions <- plugin.tasks if taskActions.name == "Dataset";
        task <- taskActions.projectTasks(project)) {
        @toolboxOperator(task, taskActions)
    }
  </div>
</div>

@**
 * A single operator in the toolbox.
 *@
@toolboxOperator(task: ProjectTask[_ <: TaskSpec], taskActions: TaskActions[_]) = {
  <div id="toolbox_@task.id" class="toolboxOperator" title="@task.id">
    @*<img src="@icon">*@
    @task.id
    @if(taskActions.name != "Dataset") {
      @operator(project, task, taskActions)
    } else {
      @dataset(project, task, taskActions)
    }
  </div>
}